package com.fjut.controller;

import com.fjut.result.Result;
import com.fjut.service.FileService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@Api(tags = "上传云服务")
@RestController
@RequestMapping("/fjut/vod/file")
//@CrossOrigin
public class FileUpLoadController {

    @Autowired
    private FileService fileService;

    @ApiOperation("文件上传")
    @PostMapping("upload")
    public Result uploadFile(MultipartFile file){
        String path = fileService.upload(file);
        return Result.success(path).message("上传文件成功");
    }
}
